package com.baidu.Chapter02;

import java.util.Scanner;

public class ex2_6 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("Enter a number between 0 and 1000：");
        int number=sc.nextInt();
        int g=number%10;
        int s=number/10%10;
        int b=number/100;
        System.out.println("The sum of the digits is "+(g+s+b));
    }
}
